package Demo;

//计算出生日期到现在相差天数

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Demo02Test {

    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您·得到的出生日期，格式为yyyy-MM-dd");
        String birthdayDateString = sc.next();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date birthdayDate = sdf.parse(birthdayDateString);
        long birthdayDateTime = birthdayDate.getTime();
        long todayTime = new Date().getTime();
        long time = todayTime - birthdayDateTime;
        System.out.println("天数" + time/1000/3600/24);
        System.out.println("毫秒" + time);
    }
}
